package com.gdd.videos.mini_api.controller;

import com.gdd.videos.common.common.GddResult;
import com.gdd.videos.pojo.Bgm;
import com.gdd.videos.service.BgmService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhangh     
 * @version V1.0.0
 * @projectName parent
 * @title     BgmController   
 * @package    com.gdd.videos.mini_api.controller  
 * @date   2019/9/6 14:02  
 * @explain
 */
@RestController
@RequestMapping("/bgm")
@Api(value = "背景音乐接口",tags = "微信端背景音乐相关的controller")
@Slf4j
public class BgmController {

    @Autowired
    private BgmService bgmService;


    @ApiOperation(value = "获取背景音乐列表",notes = "获取背景音乐列表")
    @GetMapping("/queryBgmList")
    public GddResult queryBgmList() throws Exception {
        log.info("queryBgmList ----> start");
        List<Bgm> bgms = bgmService.selectAll();
        return GddResult.ok(bgms);
    }

}
